package com.cskaoyan.gateway.utils;

import com.mall.user.dto.CheckAuthRequest;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author Hedgehog
 * @Date 2021/6/19 17:27
 * @Version 1.0
 */
public class GetJwtUtils {

    //封装了一个获取jwt的工具类
    public String getJwt(HttpServletRequest httpServletRequest){
        String access_token=null;
        Cookie[] cookies = httpServletRequest.getCookies();
        for (Cookie cookie : cookies) {
            if ("access_token".equals(cookie.getName())){
                 access_token = cookie.getValue();
            }
        }
        return access_token;
    }

}
